<?php
namespace Home\Controller;
// use Think\Controller;
use Common\Controller\BaseController;
class IndexController extends BaseController {
    public function index(){
    		// $m=M('Agent');
    		// dump($m);
    		// $d=D('Agent');
    		// dump($d);
    		// $m1=new \Home\Model\AgentModel;
    		// dump($m1);
        // $tag=new \Lib\My();
        // dump($tag);
        $my=new \Home\Model\MyModel();
        dump($my);
        echo "home";
       // $this->display();

    }
    public function show(){
        dump($_GET);
    }
    public function add()
    {
        if(IS_POST)
        {
            $config=array(
                'rootPath'=>'./Uploads/',
                'saveName'=>array('md5','mt_rand','uniqid'),
                'hash'=>false
                );
            $upload = new \Think\Upload($config);// 实例化上传类
           // $upload->savename='md5';
              $info   =   $upload->upload();
              dump($info);exit;
        }
        $this->display();
    }
     public function getBaiduApi(){
        $latlon=I('get.latlon');
        $url= "http://api.map.baidu.com/geocoder/v2/?ak=95ddvSDNjViUZ26iHYfPEaGx&callback=renderReverse&location=".$latlon."&output=json&pois=0";
        $data=file_get_contents($url);
       // echo $data;exit;
       $data=substr($data,stripos($data,'(')+1,-1);
            echo $data;exit;
    }
}